package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@TableName("sys_dict_item")
@Data
@Schema(description = "字典项")
public class DictItem {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @NotNull(message = "字典ID不能为空")
    @TableField("dict_id")
    private Long dictId;

    @NotNull(message = "键名不能为空")
    @Schema(description = "键名")
    private String key;

    @NotNull(message = "键值不能为空")
    @Schema(description = "键值")
    private String content;

    @Schema(description = "描述")
    private String description;

    @TableField("sort_order")
    private Integer sortOrder;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
